<?php

class CreditMemo extends BaseCreditMemo
{
  public function getInvoiceId(){
    return $this->getInvoice()->getInvoiceNumber();
  }
  
  public function getCreditId(){
    return $this->getCreditType().'-'.$this->getCreditNumber();
  }
  
  public function getListName(){
    return $this->getAccountCustomer()->getContact()->getListName();
  }
  
  public function getCreditDate(){
    return $this->getDocument()->getDocumentDate();
  }
  
  public function getTaxDescription(){
    $c = new Criteria();
    $c->add(ListTaxCodesPeer::TAX_CODE,$this->getTaxCode());
    $listTaxCodes = ListTaxCodesPeer::doSelectOne($c);
    if($listTaxCodes)
      return $listTaxCodes->getDescription().', '.$listTaxCodes->getTaxRate().'%';
    else
      return '';
  }
  

}
